const x: Array<string> = ['a', 'b'];
const y: ReadonlyArray<string> = ['a', 'b'];
export { x, y };

let a: Array<number> = [];

let a: Array<string | number> = [];

let a: ReadonlyArray<number> = [];

let a: ReadonlyArray<string | number> = [];

let a: { foo: Array<Bar> }[] = [];

function foo(a: Array<Bar>): Array<Bar> {}

let x: Array<undefined> = [undefined] as undefined[];

let y: string[] = <Array<string>>['2'];

let z: Array = [3, '4'];

type Arr<T> = Array<T>;

let yyyy: Arr<Array<Arr<string>>[]> = [[[['2']]]];

interface ArrayClass<T> {
  foo: Array<T>;
  bar: T[];
  baz: Arr<T>;
}

function fooFunction(foo: Array<ArrayClass<string>>) {
  return foo.map(e => e.foo);
}

let fooVar: Array<(c: number) => number>;

type fooUnion = Array<string | number | boolean>;

type fooIntersection = Array<string & number>;

let x: Array;

let x: Array<>;

type Unwrap<T> = T extends Array<infer E> ? E : T;

type Foo = ReadonlyArray<object>[];

const foo: Array<new (...args: any[]) => void> = [];

const foo: ReadonlyArray<new (...args: any[]) => void> = [];